#test-post.py
import http.client, urllib.parse
params = {'first_param' : 1, 'second_param' : 2, 'third_param' : 3}
params = urllib.parse.urlencode(params)
headers = {"Content-type": "application/x-www-form-urlencoded", "Accept": "text/plain"}
conn = http.client.HTTPConnection('127.0.0.1',5000)
conn.request("POST", "/todos", params, headers)
response = conn.getresponse()
data = response.read()
print(data)
conn.close()